package com.wang.spring;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import org.springframework.dao.DataAccessException;
import org.springframework.jdbc.core.ResultSetExtractor;
import org.springframework.jdbc.core.RowMapper;

public class UserInfoRowMapper implements RowMapper<UserInfo>{

	@Override
	public UserInfo mapRow(ResultSet rs, int paramInt) throws SQLException {		
		return mapUserInfo(rs);
	}
	
	private UserInfo mapUserInfo(ResultSet rs) throws SQLException{
		UserInfo user = new UserInfo();
		user.setUsername(rs.getString("USERNAME"));
		user.setPassword(rs.getString("PASSWORD"));
		user.setUserRole(rs.getString("USER_ROLE"));
		return user;
	}
	
	
}
